﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using TXTD.Admin.Data.Entitys;
using TXTD.Admin.Model.Paging;

namespace TXTD.Admin.Interface
{
    public interface IBaseService<T> where T : BaseEntity
    {
        DbSet<T> QueryAllData();
        PageResult<TargetT> QueryPageList<TargetT>(Expression<Func<T, bool>> where)
            where TargetT : class, new();
        /// <summary>
        /// 添加一条数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        int InsertModel(T t);
        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        int RemoveModel(T t);
    }
}